<% use_page_title "Redirects" %>
<%= render layout: 'page_title' do %>
    <%= link_to "Add", new_redirect_path, class: 'btn btn-primary btn-small right' %>
<% end %>
<%= render layout: 'main_content' do %>
    <table class="data cms-content-table table table-striped table-bordered table-hover">
      <thead>
      <tr>
        <th>From</th>
        <th>To</th>
        <th>Actions</th>
      </tr>
      </thead>
      <% @redirects.each do |redirect| %>
          <tr>
            <td><%= redirect.from_path %></td>
            <td><%= redirect.to_path %></td>
            <td>
              <%= link_to "Edit", edit_polymorphic_path(redirect), class: "btn btn-mini" %>
              <%= link_to "Delete", polymorphic_path(redirect), class: "btn btn-mini btn-danger", method: 'delete', data: {confirm: 'Are you sure you want to delete this redirect?'} %>
            </td>
          </tr>
      <% end %>
    </table>
<% end %>